package javolution.text;

import java.io.IOException;
import javolution.text.TextFormat;

/* loaded from: classes2.dex */
public final class TypeFormat {
    private TypeFormat() {
    }

    private static void appendTo(Object obj, TextBuilder textBuilder) throws IOException {
        if (obj instanceof StringBuffer) {
            textBuilder.appendTo((StringBuffer) obj);
        } else if (obj instanceof StringBuilder) {
            textBuilder.appendTo((StringBuilder) obj);
        } else {
            ((Appendable) obj).append(textBuilder);
        }
    }

    public static Appendable format(double d, int i, boolean z, boolean z2, Appendable appendable) throws IOException {
        if (appendable instanceof TextBuilder) {
            return ((TextBuilder) appendable).append(d, i, z, z2);
        }
        TextBuilder newInstance = TextBuilder.newInstance();
        newInstance.append(d, i, z, z2);
        appendTo(appendable, newInstance);
        TextBuilder.recycle(newInstance);
        return appendable;
    }

    public static Appendable format(double d, Appendable appendable) throws IOException {
        if (appendable instanceof TextBuilder) {
            return ((TextBuilder) appendable).append(d);
        }
        TextBuilder newInstance = TextBuilder.newInstance();
        newInstance.append(d);
        appendTo(appendable, newInstance);
        TextBuilder.recycle(newInstance);
        return appendable;
    }

    public static Appendable format(float f, Appendable appendable) throws IOException {
        if (appendable instanceof TextBuilder) {
            return ((TextBuilder) appendable).append(f);
        }
        TextBuilder newInstance = TextBuilder.newInstance();
        newInstance.append(f);
        appendTo(appendable, newInstance);
        TextBuilder.recycle(newInstance);
        return appendable;
    }

    public static Appendable format(int i, int i2, Appendable appendable) throws IOException {
        if (appendable instanceof TextBuilder) {
            return ((TextBuilder) appendable).append(i, i2);
        }
        TextBuilder newInstance = TextBuilder.newInstance();
        newInstance.append(i, i2);
        appendTo(appendable, newInstance);
        TextBuilder.recycle(newInstance);
        return appendable;
    }

    public static Appendable format(int i, Appendable appendable) throws IOException {
        if (appendable instanceof TextBuilder) {
            return ((TextBuilder) appendable).append(i);
        }
        TextBuilder newInstance = TextBuilder.newInstance();
        newInstance.append(i);
        appendTo(appendable, newInstance);
        TextBuilder.recycle(newInstance);
        return appendable;
    }

    public static Appendable format(long j, int i, Appendable appendable) throws IOException {
        if (appendable instanceof TextBuilder) {
            return ((TextBuilder) appendable).append(j, i);
        }
        TextBuilder newInstance = TextBuilder.newInstance();
        newInstance.append(j, i);
        appendTo(appendable, newInstance);
        TextBuilder.recycle(newInstance);
        return appendable;
    }

    public static Appendable format(long j, Appendable appendable) throws IOException {
        if (appendable instanceof TextBuilder) {
            return ((TextBuilder) appendable).append(j);
        }
        TextBuilder newInstance = TextBuilder.newInstance();
        newInstance.append(j);
        appendTo(appendable, newInstance);
        TextBuilder.recycle(newInstance);
        return appendable;
    }

    public static Appendable format(boolean z, Appendable appendable) throws IOException {
        Appendable append;
        char c;
        if (z) {
            append = appendable.append('t').append('r');
            c = 'u';
        } else {
            append = appendable.append('f').append('a').append('l');
            c = 's';
        }
        return append.append(c).append('e');
    }

    static boolean match(String str, CharSequence charSequence, int i, int i2) {
        for (int i3 = 0; i3 < str.length(); i3++) {
            int i4 = i + i3;
            if (i4 >= i2 || charSequence.charAt(i4) != str.charAt(i3)) {
                return false;
            }
        }
        return true;
    }

    static boolean match(String str, String str2, int i, int i2) {
        for (int i3 = 0; i3 < str.length(); i3++) {
            int i4 = i + i3;
            if (i4 >= i2 || str2.charAt(i4) != str.charAt(i3)) {
                return false;
            }
        }
        return true;
    }

    public static boolean parseBoolean(CharSequence charSequence) {
        if (charSequence.length() == 4 && ((charSequence.charAt(0) == 't' || charSequence.charAt(0) == 'T') && ((charSequence.charAt(1) == 'r' || charSequence.charAt(1) == 'R') && ((charSequence.charAt(2) == 'u' || charSequence.charAt(2) == 'U') && (charSequence.charAt(3) == 'e' || charSequence.charAt(3) == 'E'))))) {
            return true;
        }
        if (charSequence.length() == 5 && ((charSequence.charAt(0) == 'f' || charSequence.charAt(0) == 'F') && ((charSequence.charAt(1) == 'a' || charSequence.charAt(1) == 'A') && ((charSequence.charAt(2) == 'l' || charSequence.charAt(2) == 'L') && ((charSequence.charAt(3) == 's' || charSequence.charAt(3) == 'S') && (charSequence.charAt(4) == 'e' || charSequence.charAt(4) == 'E')))))) {
            return false;
        }
        throw new IllegalArgumentException("Cannot parse " + ((Object) charSequence) + " as boolean");
    }

    public static boolean parseBoolean(CharSequence charSequence, TextFormat.Cursor cursor) {
        int index = cursor.getIndex();
        int i = index + 4;
        if (cursor.getEndIndex() >= i && (charSequence.charAt(index) == 't' || charSequence.charAt(index) == 'T')) {
            int i2 = index + 1;
            if (charSequence.charAt(i2) == 'r' || charSequence.charAt(i2) == 'R') {
                int i3 = index + 2;
                if (charSequence.charAt(i3) == 'u' || charSequence.charAt(i3) == 'U') {
                    int i4 = index + 3;
                    if (charSequence.charAt(i4) == 'e' || charSequence.charAt(i4) == 'E') {
                        cursor.increment(4);
                        return true;
                    }
                }
            }
        }
        if (cursor.getEndIndex() >= index + 5 && (charSequence.charAt(index) == 'f' || charSequence.charAt(index) == 'F')) {
            int i5 = index + 1;
            if (charSequence.charAt(i5) == 'a' || charSequence.charAt(i5) == 'A') {
                int i6 = index + 2;
                if (charSequence.charAt(i6) == 'l' || charSequence.charAt(i6) == 'L') {
                    int i7 = index + 3;
                    if ((charSequence.charAt(i7) == 's' || charSequence.charAt(i7) == 'S') && (charSequence.charAt(i) == 'e' || charSequence.charAt(i) == 'E')) {
                        cursor.increment(5);
                        return false;
                    }
                }
            }
        }
        throw new IllegalArgumentException("Cannot parse boolean " + ((Object) charSequence.subSequence(cursor.getIndex(), cursor.getEndIndex())));
    }

    public static boolean parseBoolean(String str) {
        if (str.length() == 4 && ((str.charAt(0) == 't' || str.charAt(0) == 'T') && ((str.charAt(1) == 'r' || str.charAt(1) == 'R') && ((str.charAt(2) == 'u' || str.charAt(2) == 'U') && (str.charAt(3) == 'e' || str.charAt(3) == 'E'))))) {
            return true;
        }
        if (str.length() == 5 && ((str.charAt(0) == 'f' || str.charAt(0) == 'F') && ((str.charAt(1) == 'a' || str.charAt(1) == 'A') && ((str.charAt(2) == 'l' || str.charAt(2) == 'L') && ((str.charAt(3) == 's' || str.charAt(3) == 'S') && (str.charAt(4) == 'e' || str.charAt(4) == 'E')))))) {
            return false;
        }
        throw new IllegalArgumentException("Cannot parse " + str + " as boolean");
    }

    public static byte parseByte(CharSequence charSequence) {
        return parseByte(charSequence, 10);
    }

    public static byte parseByte(CharSequence charSequence, int i) {
        int parseInt = parseInt(charSequence, i);
        if (parseInt < -128 || parseInt > 127) {
            throw new NumberFormatException("Overflow");
        }
        return (byte) parseInt;
    }

    public static byte parseByte(CharSequence charSequence, int i, TextFormat.Cursor cursor) {
        int parseInt = parseInt(charSequence, i, cursor);
        if (parseInt < -128 || parseInt > 127) {
            throw new NumberFormatException("Overflow");
        }
        return (byte) parseInt;
    }

    public static double parseDouble(CharSequence charSequence) throws NumberFormatException {
        return parseDouble(charSequence, null);
    }

    public static double parseDouble(CharSequence charSequence, TextFormat.Cursor cursor) throws NumberFormatException {
        return charSequence instanceof CharArray ? parseDoubleCharArray((CharArray) charSequence, cursor) : charSequence instanceof TextBuilder ? parseDoubleTextBuilder((TextBuilder) charSequence, cursor) : charSequence instanceof Text ? parseDoubleText((Text) charSequence, cursor) : charSequence instanceof String ? parseDoubleString((String) charSequence, cursor) : parseDoubleCharSequence(charSequence, cursor);
    }

    public static double parseDouble(String str) {
        return parseDoubleString(str, null);
    }

    /* JADX WARN: Code restructure failed: missing block: B:54:0x0094, code lost:
        if (r8 == false) goto L43;
     */
    /* JADX WARN: Code restructure failed: missing block: B:55:0x0096, code lost:
        r10 = -r10;
     */
    /* JADX WARN: Code restructure failed: missing block: B:56:0x0097, code lost:
        if (r12 < 0) goto L83;
     */
    /* JADX WARN: Code restructure failed: missing block: B:57:0x0099, code lost:
        r7 = true;
        r6 = (r3 - r12) - 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:58:0x009e, code lost:
        r7 = true;
        r6 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:59:0x00a0, code lost:
        if (r3 >= r4) goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:61:0x00a4, code lost:
        if (r5 == 'E') goto L50;
     */
    /* JADX WARN: Code restructure failed: missing block: B:63:0x00a8, code lost:
        if (r5 != 'e') goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:64:0x00aa, code lost:
        r3 = r3 + 1;
        r5 = r18.charAt(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:65:0x00b2, code lost:
        if (r5 != '-') goto L52;
     */
    /* JADX WARN: Code restructure failed: missing block: B:67:0x00b5, code lost:
        r7 = false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:68:0x00b6, code lost:
        if (r7 != false) goto L73;
     */
    /* JADX WARN: Code restructure failed: missing block: B:69:0x00b8, code lost:
        if (r5 != '+') goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:70:0x00ba, code lost:
        r3 = r3 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:71:0x00bc, code lost:
        if (r3 >= r4) goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:72:0x00be, code lost:
        r5 = r18.charAt(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:73:0x00c2, code lost:
        r5 = r5 - '0';
     */
    /* JADX WARN: Code restructure failed: missing block: B:74:0x00c4, code lost:
        if (r5 < 0) goto L72;
     */
    /* JADX WARN: Code restructure failed: missing block: B:75:0x00c6, code lost:
        if (r5 >= 10) goto L71;
     */
    /* JADX WARN: Code restructure failed: missing block: B:76:0x00c8, code lost:
        r5 = r5 + (r2 * 10);
     */
    /* JADX WARN: Code restructure failed: missing block: B:77:0x00cb, code lost:
        if (r5 < r2) goto L68;
     */
    /* JADX WARN: Code restructure failed: missing block: B:78:0x00cd, code lost:
        r3 = r3 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:79:0x00cf, code lost:
        if (r3 < r4) goto L63;
     */
    /* JADX WARN: Code restructure failed: missing block: B:80:0x00d1, code lost:
        r2 = r5;
     */
    /* JADX WARN: Code restructure failed: missing block: B:81:0x00d3, code lost:
        r5 = r18.charAt(r3);
        r2 = r5;
     */
    /* JADX WARN: Code restructure failed: missing block: B:83:0x00e4, code lost:
        throw new java.lang.NumberFormatException("Exponent Overflow");
     */
    /* JADX WARN: Code restructure failed: missing block: B:84:0x00e5, code lost:
        if (r7 == false) goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:85:0x00e7, code lost:
        r2 = -r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:86:0x00e8, code lost:
        if (r19 == null) goto L80;
     */
    /* JADX WARN: Code restructure failed: missing block: B:87:0x00ea, code lost:
        r19.setIndex(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:88:0x00ee, code lost:
        if (r3 < r4) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:90:0x00f5, code lost:
        return javolution.lang.MathLib.toDoublePow10(r10, r2 - r6);
     */
    /* JADX WARN: Code restructure failed: missing block: B:92:0x00fe, code lost:
        throw new java.lang.NumberFormatException("Incomplete parsing");
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static double parseDoubleCharArray(javolution.text.CharArray r18, javolution.text.TextFormat.Cursor r19) throws java.lang.NumberFormatException {
        /*
            Method dump skipped, instructions count: 256
            To view this dump change 'Code comments level' option to 'DEBUG'
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseDoubleCharArray(javolution.text.CharArray, javolution.text.TextFormat$Cursor):double");
    }

    /* JADX WARN: Code restructure failed: missing block: B:54:0x0094, code lost:
        if (r8 == false) goto L43;
     */
    /* JADX WARN: Code restructure failed: missing block: B:55:0x0096, code lost:
        r10 = -r10;
     */
    /* JADX WARN: Code restructure failed: missing block: B:56:0x0097, code lost:
        if (r12 < 0) goto L83;
     */
    /* JADX WARN: Code restructure failed: missing block: B:57:0x0099, code lost:
        r7 = true;
        r6 = (r3 - r12) - 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:58:0x009e, code lost:
        r7 = true;
        r6 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:59:0x00a0, code lost:
        if (r3 >= r4) goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:61:0x00a4, code lost:
        if (r5 == 'E') goto L50;
     */
    /* JADX WARN: Code restructure failed: missing block: B:63:0x00a8, code lost:
        if (r5 != 'e') goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:64:0x00aa, code lost:
        r3 = r3 + 1;
        r5 = r18.charAt(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:65:0x00b2, code lost:
        if (r5 != '-') goto L52;
     */
    /* JADX WARN: Code restructure failed: missing block: B:67:0x00b5, code lost:
        r7 = false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:68:0x00b6, code lost:
        if (r7 != false) goto L73;
     */
    /* JADX WARN: Code restructure failed: missing block: B:69:0x00b8, code lost:
        if (r5 != '+') goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:70:0x00ba, code lost:
        r3 = r3 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:71:0x00bc, code lost:
        if (r3 >= r4) goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:72:0x00be, code lost:
        r5 = r18.charAt(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:73:0x00c2, code lost:
        r5 = r5 - '0';
     */
    /* JADX WARN: Code restructure failed: missing block: B:74:0x00c4, code lost:
        if (r5 < 0) goto L72;
     */
    /* JADX WARN: Code restructure failed: missing block: B:75:0x00c6, code lost:
        if (r5 >= 10) goto L71;
     */
    /* JADX WARN: Code restructure failed: missing block: B:76:0x00c8, code lost:
        r5 = r5 + (r2 * 10);
     */
    /* JADX WARN: Code restructure failed: missing block: B:77:0x00cb, code lost:
        if (r5 < r2) goto L68;
     */
    /* JADX WARN: Code restructure failed: missing block: B:78:0x00cd, code lost:
        r3 = r3 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:79:0x00cf, code lost:
        if (r3 < r4) goto L63;
     */
    /* JADX WARN: Code restructure failed: missing block: B:80:0x00d1, code lost:
        r2 = r5;
     */
    /* JADX WARN: Code restructure failed: missing block: B:81:0x00d3, code lost:
        r5 = r18.charAt(r3);
        r2 = r5;
     */
    /* JADX WARN: Code restructure failed: missing block: B:83:0x00e4, code lost:
        throw new java.lang.NumberFormatException("Exponent Overflow");
     */
    /* JADX WARN: Code restructure failed: missing block: B:84:0x00e5, code lost:
        if (r7 == false) goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:85:0x00e7, code lost:
        r2 = -r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:86:0x00e8, code lost:
        if (r19 == null) goto L80;
     */
    /* JADX WARN: Code restructure failed: missing block: B:87:0x00ea, code lost:
        r19.setIndex(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:88:0x00ee, code lost:
        if (r3 < r4) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:90:0x00f5, code lost:
        return javolution.lang.MathLib.toDoublePow10(r10, r2 - r6);
     */
    /* JADX WARN: Code restructure failed: missing block: B:92:0x00fe, code lost:
        throw new java.lang.NumberFormatException("Incomplete parsing");
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static double parseDoubleCharSequence(java.lang.CharSequence r18, javolution.text.TextFormat.Cursor r19) throws java.lang.NumberFormatException {
        /*
            Method dump skipped, instructions count: 256
            To view this dump change 'Code comments level' option to 'DEBUG'
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseDoubleCharSequence(java.lang.CharSequence, javolution.text.TextFormat$Cursor):double");
    }

    /* JADX WARN: Code restructure failed: missing block: B:54:0x0094, code lost:
        if (r8 == false) goto L43;
     */
    /* JADX WARN: Code restructure failed: missing block: B:55:0x0096, code lost:
        r10 = -r10;
     */
    /* JADX WARN: Code restructure failed: missing block: B:56:0x0097, code lost:
        if (r12 < 0) goto L83;
     */
    /* JADX WARN: Code restructure failed: missing block: B:57:0x0099, code lost:
        r7 = true;
        r6 = (r3 - r12) - 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:58:0x009e, code lost:
        r7 = true;
        r6 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:59:0x00a0, code lost:
        if (r3 >= r4) goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:61:0x00a4, code lost:
        if (r5 == 'E') goto L50;
     */
    /* JADX WARN: Code restructure failed: missing block: B:63:0x00a8, code lost:
        if (r5 != 'e') goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:64:0x00aa, code lost:
        r3 = r3 + 1;
        r5 = r18.charAt(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:65:0x00b2, code lost:
        if (r5 != '-') goto L52;
     */
    /* JADX WARN: Code restructure failed: missing block: B:67:0x00b5, code lost:
        r7 = false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:68:0x00b6, code lost:
        if (r7 != false) goto L73;
     */
    /* JADX WARN: Code restructure failed: missing block: B:69:0x00b8, code lost:
        if (r5 != '+') goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:70:0x00ba, code lost:
        r3 = r3 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:71:0x00bc, code lost:
        if (r3 >= r4) goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:72:0x00be, code lost:
        r5 = r18.charAt(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:73:0x00c2, code lost:
        r5 = r5 - '0';
     */
    /* JADX WARN: Code restructure failed: missing block: B:74:0x00c4, code lost:
        if (r5 < 0) goto L72;
     */
    /* JADX WARN: Code restructure failed: missing block: B:75:0x00c6, code lost:
        if (r5 >= 10) goto L71;
     */
    /* JADX WARN: Code restructure failed: missing block: B:76:0x00c8, code lost:
        r5 = r5 + (r2 * 10);
     */
    /* JADX WARN: Code restructure failed: missing block: B:77:0x00cb, code lost:
        if (r5 < r2) goto L68;
     */
    /* JADX WARN: Code restructure failed: missing block: B:78:0x00cd, code lost:
        r3 = r3 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:79:0x00cf, code lost:
        if (r3 < r4) goto L63;
     */
    /* JADX WARN: Code restructure failed: missing block: B:80:0x00d1, code lost:
        r2 = r5;
     */
    /* JADX WARN: Code restructure failed: missing block: B:81:0x00d3, code lost:
        r5 = r18.charAt(r3);
        r2 = r5;
     */
    /* JADX WARN: Code restructure failed: missing block: B:83:0x00e4, code lost:
        throw new java.lang.NumberFormatException("Exponent Overflow");
     */
    /* JADX WARN: Code restructure failed: missing block: B:84:0x00e5, code lost:
        if (r7 == false) goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:85:0x00e7, code lost:
        r2 = -r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:86:0x00e8, code lost:
        if (r19 == null) goto L80;
     */
    /* JADX WARN: Code restructure failed: missing block: B:87:0x00ea, code lost:
        r19.setIndex(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:88:0x00ee, code lost:
        if (r3 < r4) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:90:0x00f5, code lost:
        return javolution.lang.MathLib.toDoublePow10(r10, r2 - r6);
     */
    /* JADX WARN: Code restructure failed: missing block: B:92:0x00fe, code lost:
        throw new java.lang.NumberFormatException("Incomplete parsing");
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static double parseDoubleString(java.lang.String r18, javolution.text.TextFormat.Cursor r19) throws java.lang.NumberFormatException {
        /*
            Method dump skipped, instructions count: 256
            To view this dump change 'Code comments level' option to 'DEBUG'
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseDoubleString(java.lang.String, javolution.text.TextFormat$Cursor):double");
    }

    /* JADX WARN: Code restructure failed: missing block: B:54:0x0094, code lost:
        if (r8 == false) goto L43;
     */
    /* JADX WARN: Code restructure failed: missing block: B:55:0x0096, code lost:
        r10 = -r10;
     */
    /* JADX WARN: Code restructure failed: missing block: B:56:0x0097, code lost:
        if (r12 < 0) goto L83;
     */
    /* JADX WARN: Code restructure failed: missing block: B:57:0x0099, code lost:
        r7 = true;
        r6 = (r3 - r12) - 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:58:0x009e, code lost:
        r7 = true;
        r6 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:59:0x00a0, code lost:
        if (r3 >= r4) goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:61:0x00a4, code lost:
        if (r5 == 'E') goto L50;
     */
    /* JADX WARN: Code restructure failed: missing block: B:63:0x00a8, code lost:
        if (r5 != 'e') goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:64:0x00aa, code lost:
        r3 = r3 + 1;
        r5 = r18.charAt(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:65:0x00b2, code lost:
        if (r5 != '-') goto L52;
     */
    /* JADX WARN: Code restructure failed: missing block: B:67:0x00b5, code lost:
        r7 = false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:68:0x00b6, code lost:
        if (r7 != false) goto L73;
     */
    /* JADX WARN: Code restructure failed: missing block: B:69:0x00b8, code lost:
        if (r5 != '+') goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:70:0x00ba, code lost:
        r3 = r3 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:71:0x00bc, code lost:
        if (r3 >= r4) goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:72:0x00be, code lost:
        r5 = r18.charAt(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:73:0x00c2, code lost:
        r5 = r5 - '0';
     */
    /* JADX WARN: Code restructure failed: missing block: B:74:0x00c4, code lost:
        if (r5 < 0) goto L72;
     */
    /* JADX WARN: Code restructure failed: missing block: B:75:0x00c6, code lost:
        if (r5 >= 10) goto L71;
     */
    /* JADX WARN: Code restructure failed: missing block: B:76:0x00c8, code lost:
        r5 = r5 + (r2 * 10);
     */
    /* JADX WARN: Code restructure failed: missing block: B:77:0x00cb, code lost:
        if (r5 < r2) goto L68;
     */
    /* JADX WARN: Code restructure failed: missing block: B:78:0x00cd, code lost:
        r3 = r3 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:79:0x00cf, code lost:
        if (r3 < r4) goto L63;
     */
    /* JADX WARN: Code restructure failed: missing block: B:80:0x00d1, code lost:
        r2 = r5;
     */
    /* JADX WARN: Code restructure failed: missing block: B:81:0x00d3, code lost:
        r5 = r18.charAt(r3);
        r2 = r5;
     */
    /* JADX WARN: Code restructure failed: missing block: B:83:0x00e4, code lost:
        throw new java.lang.NumberFormatException("Exponent Overflow");
     */
    /* JADX WARN: Code restructure failed: missing block: B:84:0x00e5, code lost:
        if (r7 == false) goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:85:0x00e7, code lost:
        r2 = -r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:86:0x00e8, code lost:
        if (r19 == null) goto L80;
     */
    /* JADX WARN: Code restructure failed: missing block: B:87:0x00ea, code lost:
        r19.setIndex(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:88:0x00ee, code lost:
        if (r3 < r4) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:90:0x00f5, code lost:
        return javolution.lang.MathLib.toDoublePow10(r10, r2 - r6);
     */
    /* JADX WARN: Code restructure failed: missing block: B:92:0x00fe, code lost:
        throw new java.lang.NumberFormatException("Incomplete parsing");
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static double parseDoubleText(javolution.text.Text r18, javolution.text.TextFormat.Cursor r19) throws java.lang.NumberFormatException {
        /*
            Method dump skipped, instructions count: 256
            To view this dump change 'Code comments level' option to 'DEBUG'
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseDoubleText(javolution.text.Text, javolution.text.TextFormat$Cursor):double");
    }

    /* JADX WARN: Code restructure failed: missing block: B:54:0x0094, code lost:
        if (r8 == false) goto L43;
     */
    /* JADX WARN: Code restructure failed: missing block: B:55:0x0096, code lost:
        r10 = -r10;
     */
    /* JADX WARN: Code restructure failed: missing block: B:56:0x0097, code lost:
        if (r12 < 0) goto L83;
     */
    /* JADX WARN: Code restructure failed: missing block: B:57:0x0099, code lost:
        r7 = true;
        r6 = (r3 - r12) - 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:58:0x009e, code lost:
        r7 = true;
        r6 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:59:0x00a0, code lost:
        if (r3 >= r4) goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:61:0x00a4, code lost:
        if (r5 == 'E') goto L50;
     */
    /* JADX WARN: Code restructure failed: missing block: B:63:0x00a8, code lost:
        if (r5 != 'e') goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:64:0x00aa, code lost:
        r3 = r3 + 1;
        r5 = r18.charAt(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:65:0x00b2, code lost:
        if (r5 != '-') goto L52;
     */
    /* JADX WARN: Code restructure failed: missing block: B:67:0x00b5, code lost:
        r7 = false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:68:0x00b6, code lost:
        if (r7 != false) goto L73;
     */
    /* JADX WARN: Code restructure failed: missing block: B:69:0x00b8, code lost:
        if (r5 != '+') goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:70:0x00ba, code lost:
        r3 = r3 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:71:0x00bc, code lost:
        if (r3 >= r4) goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:72:0x00be, code lost:
        r5 = r18.charAt(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:73:0x00c2, code lost:
        r5 = r5 - '0';
     */
    /* JADX WARN: Code restructure failed: missing block: B:74:0x00c4, code lost:
        if (r5 < 0) goto L72;
     */
    /* JADX WARN: Code restructure failed: missing block: B:75:0x00c6, code lost:
        if (r5 >= 10) goto L71;
     */
    /* JADX WARN: Code restructure failed: missing block: B:76:0x00c8, code lost:
        r5 = r5 + (r2 * 10);
     */
    /* JADX WARN: Code restructure failed: missing block: B:77:0x00cb, code lost:
        if (r5 < r2) goto L68;
     */
    /* JADX WARN: Code restructure failed: missing block: B:78:0x00cd, code lost:
        r3 = r3 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:79:0x00cf, code lost:
        if (r3 < r4) goto L63;
     */
    /* JADX WARN: Code restructure failed: missing block: B:80:0x00d1, code lost:
        r2 = r5;
     */
    /* JADX WARN: Code restructure failed: missing block: B:81:0x00d3, code lost:
        r5 = r18.charAt(r3);
        r2 = r5;
     */
    /* JADX WARN: Code restructure failed: missing block: B:83:0x00e4, code lost:
        throw new java.lang.NumberFormatException("Exponent Overflow");
     */
    /* JADX WARN: Code restructure failed: missing block: B:84:0x00e5, code lost:
        if (r7 == false) goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:85:0x00e7, code lost:
        r2 = -r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:86:0x00e8, code lost:
        if (r19 == null) goto L80;
     */
    /* JADX WARN: Code restructure failed: missing block: B:87:0x00ea, code lost:
        r19.setIndex(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:88:0x00ee, code lost:
        if (r3 < r4) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:90:0x00f5, code lost:
        return javolution.lang.MathLib.toDoublePow10(r10, r2 - r6);
     */
    /* JADX WARN: Code restructure failed: missing block: B:92:0x00fe, code lost:
        throw new java.lang.NumberFormatException("Incomplete parsing");
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static double parseDoubleTextBuilder(javolution.text.TextBuilder r18, javolution.text.TextFormat.Cursor r19) throws java.lang.NumberFormatException {
        /*
            Method dump skipped, instructions count: 256
            To view this dump change 'Code comments level' option to 'DEBUG'
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseDoubleTextBuilder(javolution.text.TextBuilder, javolution.text.TextFormat$Cursor):double");
    }

    public static float parseFloat(CharSequence charSequence) {
        return (float) parseDouble(charSequence);
    }

    public static float parseFloat(CharSequence charSequence, TextFormat.Cursor cursor) {
        return (float) parseDouble(charSequence, cursor);
    }

    public static float parseFloat(String str) {
        return (float) parseDoubleString(str, null);
    }

    public static int parseInt(CharSequence charSequence) {
        return parseInt(charSequence, 10);
    }

    public static int parseInt(CharSequence charSequence, int i) {
        return parseInt(charSequence, i, null);
    }

    public static int parseInt(CharSequence charSequence, int i, TextFormat.Cursor cursor) {
        return charSequence instanceof CharArray ? parseIntCharArray((CharArray) charSequence, i, cursor) : charSequence instanceof TextBuilder ? parseIntTextBuilder((TextBuilder) charSequence, i, cursor) : charSequence instanceof Text ? parseIntText((Text) charSequence, i, cursor) : charSequence instanceof String ? parseIntString((String) charSequence, i, cursor) : parseIntCharSequence(charSequence, i, cursor);
    }

    public static int parseInt(String str) {
        return parseIntString(str, 10, null);
    }

    public static int parseInt(String str, int i) {
        return parseIntString(str, i, null);
    }

    /* JADX WARN: Removed duplicated region for block: B:60:0x00a6  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x00ac  */
    /* JADX WARN: Removed duplicated region for block: B:72:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static int parseIntCharArray(javolution.text.CharArray r8, int r9, javolution.text.TextFormat.Cursor r10) {
        /*
            r0 = 0
            if (r10 == 0) goto L8
            int r1 = r10.getIndex()
            goto L9
        L8:
            r1 = 0
        L9:
            if (r10 == 0) goto L10
            int r2 = r10.getEndIndex()
            goto L14
        L10:
            int r2 = r8.length()
        L14:
            r0 = r1
            r3 = 0
            r4 = 0
        L17:
            java.lang.String r5 = "Overflow"
            if (r0 >= r2) goto L6c
            char r6 = r8.charAt(r0)
            r7 = 57
            if (r6 > r7) goto L26
            int r7 = r6 + (-48)
            goto L3f
        L26:
            r7 = 90
            if (r6 > r7) goto L33
            r7 = 65
            if (r6 < r7) goto L33
            int r7 = r6 + (-65)
        L30:
            int r7 = r7 + 10
            goto L3f
        L33:
            r7 = 122(0x7a, float:1.71E-43)
            if (r6 > r7) goto L3e
            r7 = 97
            if (r6 < r7) goto L3e
            int r7 = r6 + (-97)
            goto L30
        L3e:
            r7 = -1
        L3f:
            if (r7 < 0) goto L50
            if (r7 >= r9) goto L50
            int r6 = r3 * r9
            int r6 = r6 - r7
            if (r6 > r3) goto L4a
            r3 = r6
            goto L5e
        L4a:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            r8.<init>(r5)
            throw r8
        L50:
            r7 = 45
            if (r6 != r7) goto L58
            if (r0 != r1) goto L58
            r4 = 1
            goto L5e
        L58:
            r7 = 43
            if (r6 != r7) goto L61
            if (r0 != r1) goto L61
        L5e:
            int r0 = r0 + 1
            goto L17
        L61:
            if (r10 == 0) goto L64
            goto L6c
        L64:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            java.lang.String r9 = "Incomplete parsing"
            r8.<init>(r9)
            throw r8
        L6c:
            if (r3 != 0) goto L97
            if (r2 == 0) goto L7b
            int r9 = r0 + (-1)
            char r9 = r8.charAt(r9)
            r1 = 48
            if (r9 != r1) goto L7b
            goto L97
        L7b:
            java.lang.NumberFormatException r9 = new java.lang.NumberFormatException
            java.lang.StringBuilder r10 = new java.lang.StringBuilder
            r10.<init>()
            java.lang.String r0 = "Cannot parse "
            r10.append(r0)
            r10.append(r8)
            java.lang.String r8 = " as int"
            r10.append(r8)
            java.lang.String r8 = r10.toString()
            r9.<init>(r8)
            throw r9
        L97:
            r8 = -2147483648(0xffffffff80000000, float:-0.0)
            if (r3 != r8) goto La4
            if (r4 == 0) goto L9e
            goto La4
        L9e:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            r8.<init>(r5)
            throw r8
        La4:
            if (r10 == 0) goto La9
            r10.setIndex(r0)
        La9:
            if (r4 == 0) goto Lac
            goto Lad
        Lac:
            int r3 = -r3
        Lad:
            return r3
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseIntCharArray(javolution.text.CharArray, int, javolution.text.TextFormat$Cursor):int");
    }

    /* JADX WARN: Removed duplicated region for block: B:60:0x00a6  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x00ac  */
    /* JADX WARN: Removed duplicated region for block: B:72:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static int parseIntCharSequence(java.lang.CharSequence r8, int r9, javolution.text.TextFormat.Cursor r10) {
        /*
            r0 = 0
            if (r10 == 0) goto L8
            int r1 = r10.getIndex()
            goto L9
        L8:
            r1 = 0
        L9:
            if (r10 == 0) goto L10
            int r2 = r10.getEndIndex()
            goto L14
        L10:
            int r2 = r8.length()
        L14:
            r0 = r1
            r3 = 0
            r4 = 0
        L17:
            java.lang.String r5 = "Overflow"
            if (r0 >= r2) goto L6c
            char r6 = r8.charAt(r0)
            r7 = 57
            if (r6 > r7) goto L26
            int r7 = r6 + (-48)
            goto L3f
        L26:
            r7 = 90
            if (r6 > r7) goto L33
            r7 = 65
            if (r6 < r7) goto L33
            int r7 = r6 + (-65)
        L30:
            int r7 = r7 + 10
            goto L3f
        L33:
            r7 = 122(0x7a, float:1.71E-43)
            if (r6 > r7) goto L3e
            r7 = 97
            if (r6 < r7) goto L3e
            int r7 = r6 + (-97)
            goto L30
        L3e:
            r7 = -1
        L3f:
            if (r7 < 0) goto L50
            if (r7 >= r9) goto L50
            int r6 = r3 * r9
            int r6 = r6 - r7
            if (r6 > r3) goto L4a
            r3 = r6
            goto L5e
        L4a:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            r8.<init>(r5)
            throw r8
        L50:
            r7 = 45
            if (r6 != r7) goto L58
            if (r0 != r1) goto L58
            r4 = 1
            goto L5e
        L58:
            r7 = 43
            if (r6 != r7) goto L61
            if (r0 != r1) goto L61
        L5e:
            int r0 = r0 + 1
            goto L17
        L61:
            if (r10 == 0) goto L64
            goto L6c
        L64:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            java.lang.String r9 = "Incomplete parsing"
            r8.<init>(r9)
            throw r8
        L6c:
            if (r3 != 0) goto L97
            if (r2 == 0) goto L7b
            int r9 = r0 + (-1)
            char r9 = r8.charAt(r9)
            r1 = 48
            if (r9 != r1) goto L7b
            goto L97
        L7b:
            java.lang.NumberFormatException r9 = new java.lang.NumberFormatException
            java.lang.StringBuilder r10 = new java.lang.StringBuilder
            r10.<init>()
            java.lang.String r0 = "Cannot parse "
            r10.append(r0)
            r10.append(r8)
            java.lang.String r8 = " as int"
            r10.append(r8)
            java.lang.String r8 = r10.toString()
            r9.<init>(r8)
            throw r9
        L97:
            r8 = -2147483648(0xffffffff80000000, float:-0.0)
            if (r3 != r8) goto La4
            if (r4 == 0) goto L9e
            goto La4
        L9e:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            r8.<init>(r5)
            throw r8
        La4:
            if (r10 == 0) goto La9
            r10.setIndex(r0)
        La9:
            if (r4 == 0) goto Lac
            goto Lad
        Lac:
            int r3 = -r3
        Lad:
            return r3
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseIntCharSequence(java.lang.CharSequence, int, javolution.text.TextFormat$Cursor):int");
    }

    /* JADX WARN: Removed duplicated region for block: B:60:0x00a6  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x00ac  */
    /* JADX WARN: Removed duplicated region for block: B:72:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static int parseIntString(java.lang.String r8, int r9, javolution.text.TextFormat.Cursor r10) {
        /*
            r0 = 0
            if (r10 == 0) goto L8
            int r1 = r10.getIndex()
            goto L9
        L8:
            r1 = 0
        L9:
            if (r10 == 0) goto L10
            int r2 = r10.getEndIndex()
            goto L14
        L10:
            int r2 = r8.length()
        L14:
            r0 = r1
            r3 = 0
            r4 = 0
        L17:
            java.lang.String r5 = "Overflow"
            if (r0 >= r2) goto L6c
            char r6 = r8.charAt(r0)
            r7 = 57
            if (r6 > r7) goto L26
            int r7 = r6 + (-48)
            goto L3f
        L26:
            r7 = 90
            if (r6 > r7) goto L33
            r7 = 65
            if (r6 < r7) goto L33
            int r7 = r6 + (-65)
        L30:
            int r7 = r7 + 10
            goto L3f
        L33:
            r7 = 122(0x7a, float:1.71E-43)
            if (r6 > r7) goto L3e
            r7 = 97
            if (r6 < r7) goto L3e
            int r7 = r6 + (-97)
            goto L30
        L3e:
            r7 = -1
        L3f:
            if (r7 < 0) goto L50
            if (r7 >= r9) goto L50
            int r6 = r3 * r9
            int r6 = r6 - r7
            if (r6 > r3) goto L4a
            r3 = r6
            goto L5e
        L4a:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            r8.<init>(r5)
            throw r8
        L50:
            r7 = 45
            if (r6 != r7) goto L58
            if (r0 != r1) goto L58
            r4 = 1
            goto L5e
        L58:
            r7 = 43
            if (r6 != r7) goto L61
            if (r0 != r1) goto L61
        L5e:
            int r0 = r0 + 1
            goto L17
        L61:
            if (r10 == 0) goto L64
            goto L6c
        L64:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            java.lang.String r9 = "Incomplete parsing"
            r8.<init>(r9)
            throw r8
        L6c:
            if (r3 != 0) goto L97
            if (r2 == 0) goto L7b
            int r9 = r0 + (-1)
            char r9 = r8.charAt(r9)
            r1 = 48
            if (r9 != r1) goto L7b
            goto L97
        L7b:
            java.lang.NumberFormatException r9 = new java.lang.NumberFormatException
            java.lang.StringBuilder r10 = new java.lang.StringBuilder
            r10.<init>()
            java.lang.String r0 = "Cannot parse "
            r10.append(r0)
            r10.append(r8)
            java.lang.String r8 = " as int"
            r10.append(r8)
            java.lang.String r8 = r10.toString()
            r9.<init>(r8)
            throw r9
        L97:
            r8 = -2147483648(0xffffffff80000000, float:-0.0)
            if (r3 != r8) goto La4
            if (r4 == 0) goto L9e
            goto La4
        L9e:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            r8.<init>(r5)
            throw r8
        La4:
            if (r10 == 0) goto La9
            r10.setIndex(r0)
        La9:
            if (r4 == 0) goto Lac
            goto Lad
        Lac:
            int r3 = -r3
        Lad:
            return r3
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseIntString(java.lang.String, int, javolution.text.TextFormat$Cursor):int");
    }

    /* JADX WARN: Removed duplicated region for block: B:60:0x00a6  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x00ac  */
    /* JADX WARN: Removed duplicated region for block: B:72:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static int parseIntText(javolution.text.Text r8, int r9, javolution.text.TextFormat.Cursor r10) {
        /*
            r0 = 0
            if (r10 == 0) goto L8
            int r1 = r10.getIndex()
            goto L9
        L8:
            r1 = 0
        L9:
            if (r10 == 0) goto L10
            int r2 = r10.getEndIndex()
            goto L14
        L10:
            int r2 = r8.length()
        L14:
            r0 = r1
            r3 = 0
            r4 = 0
        L17:
            java.lang.String r5 = "Overflow"
            if (r0 >= r2) goto L6c
            char r6 = r8.charAt(r0)
            r7 = 57
            if (r6 > r7) goto L26
            int r7 = r6 + (-48)
            goto L3f
        L26:
            r7 = 90
            if (r6 > r7) goto L33
            r7 = 65
            if (r6 < r7) goto L33
            int r7 = r6 + (-65)
        L30:
            int r7 = r7 + 10
            goto L3f
        L33:
            r7 = 122(0x7a, float:1.71E-43)
            if (r6 > r7) goto L3e
            r7 = 97
            if (r6 < r7) goto L3e
            int r7 = r6 + (-97)
            goto L30
        L3e:
            r7 = -1
        L3f:
            if (r7 < 0) goto L50
            if (r7 >= r9) goto L50
            int r6 = r3 * r9
            int r6 = r6 - r7
            if (r6 > r3) goto L4a
            r3 = r6
            goto L5e
        L4a:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            r8.<init>(r5)
            throw r8
        L50:
            r7 = 45
            if (r6 != r7) goto L58
            if (r0 != r1) goto L58
            r4 = 1
            goto L5e
        L58:
            r7 = 43
            if (r6 != r7) goto L61
            if (r0 != r1) goto L61
        L5e:
            int r0 = r0 + 1
            goto L17
        L61:
            if (r10 == 0) goto L64
            goto L6c
        L64:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            java.lang.String r9 = "Incomplete parsing"
            r8.<init>(r9)
            throw r8
        L6c:
            if (r3 != 0) goto L97
            if (r2 == 0) goto L7b
            int r9 = r0 + (-1)
            char r9 = r8.charAt(r9)
            r1 = 48
            if (r9 != r1) goto L7b
            goto L97
        L7b:
            java.lang.NumberFormatException r9 = new java.lang.NumberFormatException
            java.lang.StringBuilder r10 = new java.lang.StringBuilder
            r10.<init>()
            java.lang.String r0 = "Cannot parse "
            r10.append(r0)
            r10.append(r8)
            java.lang.String r8 = " as int"
            r10.append(r8)
            java.lang.String r8 = r10.toString()
            r9.<init>(r8)
            throw r9
        L97:
            r8 = -2147483648(0xffffffff80000000, float:-0.0)
            if (r3 != r8) goto La4
            if (r4 == 0) goto L9e
            goto La4
        L9e:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            r8.<init>(r5)
            throw r8
        La4:
            if (r10 == 0) goto La9
            r10.setIndex(r0)
        La9:
            if (r4 == 0) goto Lac
            goto Lad
        Lac:
            int r3 = -r3
        Lad:
            return r3
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseIntText(javolution.text.Text, int, javolution.text.TextFormat$Cursor):int");
    }

    /* JADX WARN: Removed duplicated region for block: B:60:0x00a6  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x00ac  */
    /* JADX WARN: Removed duplicated region for block: B:72:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static int parseIntTextBuilder(javolution.text.TextBuilder r8, int r9, javolution.text.TextFormat.Cursor r10) {
        /*
            r0 = 0
            if (r10 == 0) goto L8
            int r1 = r10.getIndex()
            goto L9
        L8:
            r1 = 0
        L9:
            if (r10 == 0) goto L10
            int r2 = r10.getEndIndex()
            goto L14
        L10:
            int r2 = r8.length()
        L14:
            r0 = r1
            r3 = 0
            r4 = 0
        L17:
            java.lang.String r5 = "Overflow"
            if (r0 >= r2) goto L6c
            char r6 = r8.charAt(r0)
            r7 = 57
            if (r6 > r7) goto L26
            int r7 = r6 + (-48)
            goto L3f
        L26:
            r7 = 90
            if (r6 > r7) goto L33
            r7 = 65
            if (r6 < r7) goto L33
            int r7 = r6 + (-65)
        L30:
            int r7 = r7 + 10
            goto L3f
        L33:
            r7 = 122(0x7a, float:1.71E-43)
            if (r6 > r7) goto L3e
            r7 = 97
            if (r6 < r7) goto L3e
            int r7 = r6 + (-97)
            goto L30
        L3e:
            r7 = -1
        L3f:
            if (r7 < 0) goto L50
            if (r7 >= r9) goto L50
            int r6 = r3 * r9
            int r6 = r6 - r7
            if (r6 > r3) goto L4a
            r3 = r6
            goto L5e
        L4a:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            r8.<init>(r5)
            throw r8
        L50:
            r7 = 45
            if (r6 != r7) goto L58
            if (r0 != r1) goto L58
            r4 = 1
            goto L5e
        L58:
            r7 = 43
            if (r6 != r7) goto L61
            if (r0 != r1) goto L61
        L5e:
            int r0 = r0 + 1
            goto L17
        L61:
            if (r10 == 0) goto L64
            goto L6c
        L64:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            java.lang.String r9 = "Incomplete parsing"
            r8.<init>(r9)
            throw r8
        L6c:
            if (r3 != 0) goto L97
            if (r2 == 0) goto L7b
            int r9 = r0 + (-1)
            char r9 = r8.charAt(r9)
            r1 = 48
            if (r9 != r1) goto L7b
            goto L97
        L7b:
            java.lang.NumberFormatException r9 = new java.lang.NumberFormatException
            java.lang.StringBuilder r10 = new java.lang.StringBuilder
            r10.<init>()
            java.lang.String r0 = "Cannot parse "
            r10.append(r0)
            r10.append(r8)
            java.lang.String r8 = " as int"
            r10.append(r8)
            java.lang.String r8 = r10.toString()
            r9.<init>(r8)
            throw r9
        L97:
            r8 = -2147483648(0xffffffff80000000, float:-0.0)
            if (r3 != r8) goto La4
            if (r4 == 0) goto L9e
            goto La4
        L9e:
            java.lang.NumberFormatException r8 = new java.lang.NumberFormatException
            r8.<init>(r5)
            throw r8
        La4:
            if (r10 == 0) goto La9
            r10.setIndex(r0)
        La9:
            if (r4 == 0) goto Lac
            goto Lad
        Lac:
            int r3 = -r3
        Lad:
            return r3
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseIntTextBuilder(javolution.text.TextBuilder, int, javolution.text.TextFormat$Cursor):int");
    }

    public static long parseLong(CharSequence charSequence) {
        return parseLong(charSequence, 10);
    }

    public static long parseLong(CharSequence charSequence, int i) {
        return parseLong(charSequence, i, null);
    }

    public static long parseLong(CharSequence charSequence, int i, TextFormat.Cursor cursor) {
        return charSequence instanceof CharArray ? parseLongCharArray((CharArray) charSequence, i, cursor) : charSequence instanceof TextBuilder ? parseLongTextBuilder((TextBuilder) charSequence, i, cursor) : charSequence instanceof Text ? parseLongText((Text) charSequence, i, cursor) : charSequence instanceof String ? parseLongString((String) charSequence, i, cursor) : parseLongCharSequence(charSequence, i, cursor);
    }

    public static long parseLong(String str) {
        return parseLongString(str, 10, null);
    }

    public static long parseLong(String str, int i) {
        return parseLongString(str, i, null);
    }

    /* JADX WARN: Removed duplicated region for block: B:61:0x00b0  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x00b6  */
    /* JADX WARN: Removed duplicated region for block: B:73:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static long parseLongCharArray(javolution.text.CharArray r13, int r14, javolution.text.TextFormat.Cursor r15) {
        /*
            r0 = 0
            if (r15 == 0) goto L8
            int r1 = r15.getIndex()
            goto L9
        L8:
            r1 = 0
        L9:
            if (r15 == 0) goto L10
            int r2 = r15.getEndIndex()
            goto L14
        L10:
            int r2 = r13.length()
        L14:
            r3 = 0
            r0 = r1
            r5 = r3
            r7 = 0
        L19:
            java.lang.String r8 = "Overflow"
            if (r0 >= r2) goto L72
            char r9 = r13.charAt(r0)
            r10 = 57
            if (r9 > r10) goto L28
            int r10 = r9 + (-48)
            goto L41
        L28:
            r10 = 90
            if (r9 > r10) goto L35
            r10 = 65
            if (r9 < r10) goto L35
            int r10 = r9 + (-65)
        L32:
            int r10 = r10 + 10
            goto L41
        L35:
            r10 = 122(0x7a, float:1.71E-43)
            if (r9 > r10) goto L40
            r10 = 97
            if (r9 < r10) goto L40
            int r10 = r9 + (-97)
            goto L32
        L40:
            r10 = -1
        L41:
            if (r10 < 0) goto L56
            if (r10 >= r14) goto L56
            long r11 = (long) r14
            long r11 = r11 * r5
            long r9 = (long) r10
            long r11 = r11 - r9
            int r9 = (r11 > r5 ? 1 : (r11 == r5 ? 0 : -1))
            if (r9 > 0) goto L50
            r5 = r11
            goto L64
        L50:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            r13.<init>(r8)
            throw r13
        L56:
            r10 = 45
            if (r9 != r10) goto L5e
            if (r0 != r1) goto L5e
            r7 = 1
            goto L64
        L5e:
            r10 = 43
            if (r9 != r10) goto L67
            if (r0 != r1) goto L67
        L64:
            int r0 = r0 + 1
            goto L19
        L67:
            if (r15 == 0) goto L6a
            goto L72
        L6a:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            java.lang.String r14 = "Incomplete parsing"
            r13.<init>(r14)
            throw r13
        L72:
            int r14 = (r5 > r3 ? 1 : (r5 == r3 ? 0 : -1))
            if (r14 != 0) goto L9f
            if (r2 == 0) goto L83
            int r14 = r0 + (-1)
            char r14 = r13.charAt(r14)
            r1 = 48
            if (r14 != r1) goto L83
            goto L9f
        L83:
            java.lang.NumberFormatException r14 = new java.lang.NumberFormatException
            java.lang.StringBuilder r15 = new java.lang.StringBuilder
            r15.<init>()
            java.lang.String r0 = "Cannot parse "
            r15.append(r0)
            r15.append(r13)
            java.lang.String r13 = " as int"
            r15.append(r13)
            java.lang.String r13 = r15.toString()
            r14.<init>(r13)
            throw r14
        L9f:
            r13 = -9223372036854775808
            int r1 = (r5 > r13 ? 1 : (r5 == r13 ? 0 : -1))
            if (r1 != 0) goto Lae
            if (r7 == 0) goto La8
            goto Lae
        La8:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            r13.<init>(r8)
            throw r13
        Lae:
            if (r15 == 0) goto Lb3
            r15.setIndex(r0)
        Lb3:
            if (r7 == 0) goto Lb6
            goto Lb7
        Lb6:
            long r5 = -r5
        Lb7:
            return r5
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseLongCharArray(javolution.text.CharArray, int, javolution.text.TextFormat$Cursor):long");
    }

    /* JADX WARN: Removed duplicated region for block: B:61:0x00b0  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x00b6  */
    /* JADX WARN: Removed duplicated region for block: B:73:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static long parseLongCharSequence(java.lang.CharSequence r13, int r14, javolution.text.TextFormat.Cursor r15) {
        /*
            r0 = 0
            if (r15 == 0) goto L8
            int r1 = r15.getIndex()
            goto L9
        L8:
            r1 = 0
        L9:
            if (r15 == 0) goto L10
            int r2 = r15.getEndIndex()
            goto L14
        L10:
            int r2 = r13.length()
        L14:
            r3 = 0
            r0 = r1
            r5 = r3
            r7 = 0
        L19:
            java.lang.String r8 = "Overflow"
            if (r0 >= r2) goto L72
            char r9 = r13.charAt(r0)
            r10 = 57
            if (r9 > r10) goto L28
            int r10 = r9 + (-48)
            goto L41
        L28:
            r10 = 90
            if (r9 > r10) goto L35
            r10 = 65
            if (r9 < r10) goto L35
            int r10 = r9 + (-65)
        L32:
            int r10 = r10 + 10
            goto L41
        L35:
            r10 = 122(0x7a, float:1.71E-43)
            if (r9 > r10) goto L40
            r10 = 97
            if (r9 < r10) goto L40
            int r10 = r9 + (-97)
            goto L32
        L40:
            r10 = -1
        L41:
            if (r10 < 0) goto L56
            if (r10 >= r14) goto L56
            long r11 = (long) r14
            long r11 = r11 * r5
            long r9 = (long) r10
            long r11 = r11 - r9
            int r9 = (r11 > r5 ? 1 : (r11 == r5 ? 0 : -1))
            if (r9 > 0) goto L50
            r5 = r11
            goto L64
        L50:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            r13.<init>(r8)
            throw r13
        L56:
            r10 = 45
            if (r9 != r10) goto L5e
            if (r0 != r1) goto L5e
            r7 = 1
            goto L64
        L5e:
            r10 = 43
            if (r9 != r10) goto L67
            if (r0 != r1) goto L67
        L64:
            int r0 = r0 + 1
            goto L19
        L67:
            if (r15 == 0) goto L6a
            goto L72
        L6a:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            java.lang.String r14 = "Incomplete parsing"
            r13.<init>(r14)
            throw r13
        L72:
            int r14 = (r5 > r3 ? 1 : (r5 == r3 ? 0 : -1))
            if (r14 != 0) goto L9f
            if (r2 == 0) goto L83
            int r14 = r0 + (-1)
            char r14 = r13.charAt(r14)
            r1 = 48
            if (r14 != r1) goto L83
            goto L9f
        L83:
            java.lang.NumberFormatException r14 = new java.lang.NumberFormatException
            java.lang.StringBuilder r15 = new java.lang.StringBuilder
            r15.<init>()
            java.lang.String r0 = "Cannot parse "
            r15.append(r0)
            r15.append(r13)
            java.lang.String r13 = " as int"
            r15.append(r13)
            java.lang.String r13 = r15.toString()
            r14.<init>(r13)
            throw r14
        L9f:
            r13 = -9223372036854775808
            int r1 = (r5 > r13 ? 1 : (r5 == r13 ? 0 : -1))
            if (r1 != 0) goto Lae
            if (r7 == 0) goto La8
            goto Lae
        La8:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            r13.<init>(r8)
            throw r13
        Lae:
            if (r15 == 0) goto Lb3
            r15.setIndex(r0)
        Lb3:
            if (r7 == 0) goto Lb6
            goto Lb7
        Lb6:
            long r5 = -r5
        Lb7:
            return r5
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseLongCharSequence(java.lang.CharSequence, int, javolution.text.TextFormat$Cursor):long");
    }

    /* JADX WARN: Removed duplicated region for block: B:61:0x00b0  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x00b6  */
    /* JADX WARN: Removed duplicated region for block: B:73:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static long parseLongString(java.lang.String r13, int r14, javolution.text.TextFormat.Cursor r15) {
        /*
            r0 = 0
            if (r15 == 0) goto L8
            int r1 = r15.getIndex()
            goto L9
        L8:
            r1 = 0
        L9:
            if (r15 == 0) goto L10
            int r2 = r15.getEndIndex()
            goto L14
        L10:
            int r2 = r13.length()
        L14:
            r3 = 0
            r0 = r1
            r5 = r3
            r7 = 0
        L19:
            java.lang.String r8 = "Overflow"
            if (r0 >= r2) goto L72
            char r9 = r13.charAt(r0)
            r10 = 57
            if (r9 > r10) goto L28
            int r10 = r9 + (-48)
            goto L41
        L28:
            r10 = 90
            if (r9 > r10) goto L35
            r10 = 65
            if (r9 < r10) goto L35
            int r10 = r9 + (-65)
        L32:
            int r10 = r10 + 10
            goto L41
        L35:
            r10 = 122(0x7a, float:1.71E-43)
            if (r9 > r10) goto L40
            r10 = 97
            if (r9 < r10) goto L40
            int r10 = r9 + (-97)
            goto L32
        L40:
            r10 = -1
        L41:
            if (r10 < 0) goto L56
            if (r10 >= r14) goto L56
            long r11 = (long) r14
            long r11 = r11 * r5
            long r9 = (long) r10
            long r11 = r11 - r9
            int r9 = (r11 > r5 ? 1 : (r11 == r5 ? 0 : -1))
            if (r9 > 0) goto L50
            r5 = r11
            goto L64
        L50:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            r13.<init>(r8)
            throw r13
        L56:
            r10 = 45
            if (r9 != r10) goto L5e
            if (r0 != r1) goto L5e
            r7 = 1
            goto L64
        L5e:
            r10 = 43
            if (r9 != r10) goto L67
            if (r0 != r1) goto L67
        L64:
            int r0 = r0 + 1
            goto L19
        L67:
            if (r15 == 0) goto L6a
            goto L72
        L6a:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            java.lang.String r14 = "Incomplete parsing"
            r13.<init>(r14)
            throw r13
        L72:
            int r14 = (r5 > r3 ? 1 : (r5 == r3 ? 0 : -1))
            if (r14 != 0) goto L9f
            if (r2 == 0) goto L83
            int r14 = r0 + (-1)
            char r14 = r13.charAt(r14)
            r1 = 48
            if (r14 != r1) goto L83
            goto L9f
        L83:
            java.lang.NumberFormatException r14 = new java.lang.NumberFormatException
            java.lang.StringBuilder r15 = new java.lang.StringBuilder
            r15.<init>()
            java.lang.String r0 = "Cannot parse "
            r15.append(r0)
            r15.append(r13)
            java.lang.String r13 = " as int"
            r15.append(r13)
            java.lang.String r13 = r15.toString()
            r14.<init>(r13)
            throw r14
        L9f:
            r13 = -9223372036854775808
            int r1 = (r5 > r13 ? 1 : (r5 == r13 ? 0 : -1))
            if (r1 != 0) goto Lae
            if (r7 == 0) goto La8
            goto Lae
        La8:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            r13.<init>(r8)
            throw r13
        Lae:
            if (r15 == 0) goto Lb3
            r15.setIndex(r0)
        Lb3:
            if (r7 == 0) goto Lb6
            goto Lb7
        Lb6:
            long r5 = -r5
        Lb7:
            return r5
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseLongString(java.lang.String, int, javolution.text.TextFormat$Cursor):long");
    }

    /* JADX WARN: Removed duplicated region for block: B:61:0x00b0  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x00b6  */
    /* JADX WARN: Removed duplicated region for block: B:73:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static long parseLongText(javolution.text.Text r13, int r14, javolution.text.TextFormat.Cursor r15) {
        /*
            r0 = 0
            if (r15 == 0) goto L8
            int r1 = r15.getIndex()
            goto L9
        L8:
            r1 = 0
        L9:
            if (r15 == 0) goto L10
            int r2 = r15.getEndIndex()
            goto L14
        L10:
            int r2 = r13.length()
        L14:
            r3 = 0
            r0 = r1
            r5 = r3
            r7 = 0
        L19:
            java.lang.String r8 = "Overflow"
            if (r0 >= r2) goto L72
            char r9 = r13.charAt(r0)
            r10 = 57
            if (r9 > r10) goto L28
            int r10 = r9 + (-48)
            goto L41
        L28:
            r10 = 90
            if (r9 > r10) goto L35
            r10 = 65
            if (r9 < r10) goto L35
            int r10 = r9 + (-65)
        L32:
            int r10 = r10 + 10
            goto L41
        L35:
            r10 = 122(0x7a, float:1.71E-43)
            if (r9 > r10) goto L40
            r10 = 97
            if (r9 < r10) goto L40
            int r10 = r9 + (-97)
            goto L32
        L40:
            r10 = -1
        L41:
            if (r10 < 0) goto L56
            if (r10 >= r14) goto L56
            long r11 = (long) r14
            long r11 = r11 * r5
            long r9 = (long) r10
            long r11 = r11 - r9
            int r9 = (r11 > r5 ? 1 : (r11 == r5 ? 0 : -1))
            if (r9 > 0) goto L50
            r5 = r11
            goto L64
        L50:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            r13.<init>(r8)
            throw r13
        L56:
            r10 = 45
            if (r9 != r10) goto L5e
            if (r0 != r1) goto L5e
            r7 = 1
            goto L64
        L5e:
            r10 = 43
            if (r9 != r10) goto L67
            if (r0 != r1) goto L67
        L64:
            int r0 = r0 + 1
            goto L19
        L67:
            if (r15 == 0) goto L6a
            goto L72
        L6a:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            java.lang.String r14 = "Incomplete parsing"
            r13.<init>(r14)
            throw r13
        L72:
            int r14 = (r5 > r3 ? 1 : (r5 == r3 ? 0 : -1))
            if (r14 != 0) goto L9f
            if (r2 == 0) goto L83
            int r14 = r0 + (-1)
            char r14 = r13.charAt(r14)
            r1 = 48
            if (r14 != r1) goto L83
            goto L9f
        L83:
            java.lang.NumberFormatException r14 = new java.lang.NumberFormatException
            java.lang.StringBuilder r15 = new java.lang.StringBuilder
            r15.<init>()
            java.lang.String r0 = "Cannot parse "
            r15.append(r0)
            r15.append(r13)
            java.lang.String r13 = " as int"
            r15.append(r13)
            java.lang.String r13 = r15.toString()
            r14.<init>(r13)
            throw r14
        L9f:
            r13 = -9223372036854775808
            int r1 = (r5 > r13 ? 1 : (r5 == r13 ? 0 : -1))
            if (r1 != 0) goto Lae
            if (r7 == 0) goto La8
            goto Lae
        La8:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            r13.<init>(r8)
            throw r13
        Lae:
            if (r15 == 0) goto Lb3
            r15.setIndex(r0)
        Lb3:
            if (r7 == 0) goto Lb6
            goto Lb7
        Lb6:
            long r5 = -r5
        Lb7:
            return r5
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseLongText(javolution.text.Text, int, javolution.text.TextFormat$Cursor):long");
    }

    /* JADX WARN: Removed duplicated region for block: B:61:0x00b0  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x00b6  */
    /* JADX WARN: Removed duplicated region for block: B:73:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    private static long parseLongTextBuilder(javolution.text.TextBuilder r13, int r14, javolution.text.TextFormat.Cursor r15) {
        /*
            r0 = 0
            if (r15 == 0) goto L8
            int r1 = r15.getIndex()
            goto L9
        L8:
            r1 = 0
        L9:
            if (r15 == 0) goto L10
            int r2 = r15.getEndIndex()
            goto L14
        L10:
            int r2 = r13.length()
        L14:
            r3 = 0
            r0 = r1
            r5 = r3
            r7 = 0
        L19:
            java.lang.String r8 = "Overflow"
            if (r0 >= r2) goto L72
            char r9 = r13.charAt(r0)
            r10 = 57
            if (r9 > r10) goto L28
            int r10 = r9 + (-48)
            goto L41
        L28:
            r10 = 90
            if (r9 > r10) goto L35
            r10 = 65
            if (r9 < r10) goto L35
            int r10 = r9 + (-65)
        L32:
            int r10 = r10 + 10
            goto L41
        L35:
            r10 = 122(0x7a, float:1.71E-43)
            if (r9 > r10) goto L40
            r10 = 97
            if (r9 < r10) goto L40
            int r10 = r9 + (-97)
            goto L32
        L40:
            r10 = -1
        L41:
            if (r10 < 0) goto L56
            if (r10 >= r14) goto L56
            long r11 = (long) r14
            long r11 = r11 * r5
            long r9 = (long) r10
            long r11 = r11 - r9
            int r9 = (r11 > r5 ? 1 : (r11 == r5 ? 0 : -1))
            if (r9 > 0) goto L50
            r5 = r11
            goto L64
        L50:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            r13.<init>(r8)
            throw r13
        L56:
            r10 = 45
            if (r9 != r10) goto L5e
            if (r0 != r1) goto L5e
            r7 = 1
            goto L64
        L5e:
            r10 = 43
            if (r9 != r10) goto L67
            if (r0 != r1) goto L67
        L64:
            int r0 = r0 + 1
            goto L19
        L67:
            if (r15 == 0) goto L6a
            goto L72
        L6a:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            java.lang.String r14 = "Incomplete parsing"
            r13.<init>(r14)
            throw r13
        L72:
            int r14 = (r5 > r3 ? 1 : (r5 == r3 ? 0 : -1))
            if (r14 != 0) goto L9f
            if (r2 == 0) goto L83
            int r14 = r0 + (-1)
            char r14 = r13.charAt(r14)
            r1 = 48
            if (r14 != r1) goto L83
            goto L9f
        L83:
            java.lang.NumberFormatException r14 = new java.lang.NumberFormatException
            java.lang.StringBuilder r15 = new java.lang.StringBuilder
            r15.<init>()
            java.lang.String r0 = "Cannot parse "
            r15.append(r0)
            r15.append(r13)
            java.lang.String r13 = " as int"
            r15.append(r13)
            java.lang.String r13 = r15.toString()
            r14.<init>(r13)
            throw r14
        L9f:
            r13 = -9223372036854775808
            int r1 = (r5 > r13 ? 1 : (r5 == r13 ? 0 : -1))
            if (r1 != 0) goto Lae
            if (r7 == 0) goto La8
            goto Lae
        La8:
            java.lang.NumberFormatException r13 = new java.lang.NumberFormatException
            r13.<init>(r8)
            throw r13
        Lae:
            if (r15 == 0) goto Lb3
            r15.setIndex(r0)
        Lb3:
            if (r7 == 0) goto Lb6
            goto Lb7
        Lb6:
            long r5 = -r5
        Lb7:
            return r5
        */
        throw new UnsupportedOperationException("Method not decompiled: javolution.text.TypeFormat.parseLongTextBuilder(javolution.text.TextBuilder, int, javolution.text.TextFormat$Cursor):long");
    }

    public static short parseShort(CharSequence charSequence) {
        return parseShort(charSequence, 10);
    }

    public static short parseShort(CharSequence charSequence, int i) {
        int parseInt = parseInt(charSequence, i);
        if (parseInt < -32768 || parseInt > 32767) {
            throw new NumberFormatException("Overflow");
        }
        return (short) parseInt;
    }

    public static short parseShort(CharSequence charSequence, int i, TextFormat.Cursor cursor) {
        int parseInt = parseInt(charSequence, i, cursor);
        if (parseInt < -32768 || parseInt > 32767) {
            throw new NumberFormatException("Overflow");
        }
        return (short) parseInt;
    }
}
